﻿<?php
require_once("../public_files/conn.php");
require_once("../public_files/fenye.php");

session_start();
 $sort_id=$_GET['sort_id'];
 $type=$_GET['type'];
 $listname_id=$_GET['listname_id'];

if($type==0){
$table="official_list_name";
$table1="official_list_content";
}else{
$table="user_list_name";
$table1="user_list_content";
}
$qq="select * from ".$table." where id='$listname_id'";
$resultq=mysql_query($qq);
$rowq=mysql_fetch_array($resultq);
$list_name=$rowq['list_name'];
$user_id=$rowq['user_id'];
$browse_num=$rowq['browse_num'];
$vote_total=$rowq['vote_total'];
$img_path=$rowq['img_path'];
$introduction=$rowq['introduction'];
$create_time=$rowq['create_time'];

$qql="select * from ".$table1." where list_name_id='$listname_id' order by ranking desc";
$resultql=mysql_query($qql);
$rowql=mysql_fetch_array($resultql);
$content_count=$rowql['ranking'];

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible"/>
<meta name="keywords" content=""/><!--SEO关键字-->
<meta name="description" content=""/><!--SEO描述-->
<link rel ="" href=""/><!--选项卡图标-->
<title></title>
<link rel="stylesheet" href="../css/base.css"/>
<link rel="stylesheet" href="../css/all_header.css"/>
<link rel="stylesheet" href="../css/MusicListContent.css"/>
<script type="text/javascript" src="../js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="../js/check.js"></script>
<script type="text/javascript" src="../js/music.js"></script>
<script type="text/javascript" src="../js/all_header.js"></script>
<script type="text/javascript" src="../js/MusicListContent.js"></script>
<script type="text/javascript" src="../js/search.js"></script>

<!--[if lt IE 9]>
<script src="../js/html5shiv.js"></script>
<![endif]-->
<!--[if ie 6]>
<link rel="stylesheet" href="../css/ie6.css">
<script type="text/javascript" src="../js/DD_belatedPNG.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('.png');/*在需要png透明的元素里面加上.png样式即可（class="png"）*/
</script>
<![endif]-->
</head>
<body>				<!--滑动注册登录框-->

<div class="already_vote"></div>


	<div class="slide_box">
		<div class="slide_login">
				<span>邮箱:</span><br/>
				<input type="text" id="email"  onblur="cheak_email(this)" class="required" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<br/><br/>
				<span>密码:</span><br/>
				<input type="password"  value="" id="password"  style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
				<div class="text1">
					<div class="text2"><span>还没账号？</span><span onclick="show_regesit();">注册<span></div>
				<div class="login_btn"><input type="button" onclick="login(),cheak_email('#email') "name="submit" id="send" value="登录" style="width:70px;height:29px;background:#333;border:0px;color:#999;"></div>
				</div>
			
		</div>
		
		<div class="slide_regesit">
				<span>昵称:</span><br/>
				<input type="text" id="Username" name="username" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<label class="stats1">请输入用户名</label><br/>
				<br/><span>邮箱:</span><br/>
				<input type="text"name="email" id="Email" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
					<label class="stats1">请输入邮箱</label><br/>
				<br/><span>密码:</span><br/>
				<input type="password"id="Password" name="password" value="" style="width:219px;height:29px;border:0px;background:#333;color:#ddd;"/>
				<label class="stats1">请输入用户密码</label>
				<div class="text1">
					<div class="text2"><input type="checkbox" name="agreement" id="agreement"/><a>&nbsp;同意服务条款</a><br/><label>&nbsp;请阅读并同意服务条款</label></div>
					<div class="reg_btn"><input type="button"name="sub" onclick="regs('click'),register()" value="注册" style="width:70px;height:29px;background:#333;border:0px;color:#999;"></div>
				</div>
		</div>
	</div>
	<!--触发下拉框按钮-->
	<div class="slide_btn"  onclick="slide_btn();"><img class="png" src="../images/arrow_down.png"/></div>
	<!--主体-->
	<div class="container_12">
		<div class="header">
			<div class="logo"style="display:inline;float:left;">
				<img class="png" src="../images/TopWhole_logo.png"/>
			</div>
			<!--创建榜单按钮-->
			<div class="creat_list_btn"style="display:inline;float:left;margin:20px auto;">
				<input type="button" onclick="openNewDiv();" style="background:url(../images/creat_list_btn.png);width:140px;height:72px;border:0px;"/>
			</div>
			<div class="search">
				<div class="un_useful_4">
				<form action="search.php" method="post" id="search_start">
					<input type="text" id="search_box" name="search" value=""onblur="hide_result()"  oninput="cheak(this)" style="width:193px;height:25px;"/>
					
					<a href="#"><input type="submit" id="Submit" name="submit" style="background:url(../images/search_btn.png);width:17px;height:17px;border:0px;" value=""/></a>
				</form>
				</div>
				<div class="l_r_text">
				<?php if(isset($_SESSION['username'])){
				echo '<div class="un_useful_5">
						<span class="log_tetx" > <a href="../person/complete_list.php">'.$_SESSION['username'].'</a></span>
					</div>
					<div class="un_useful_6">
						<span class="un_useful_7"> | </span>
						<span class="reg_text" onclick="destroy()">退出</span>
					</div>';
				}else{ ?>
								<div class="un_useful_5">
						<span class="log_tetx" onclick="slide_btn();"> 登录 </span>
					</div>
					<div class="un_useful_6">
						<span class="un_useful_7"> | </span>
						<span class="reg_text" onclick="regesit_btn();"> 注册 </span>
					</div>
			<?php } ?>

				</div>
				<!--个人信息-->
				<div class="person_info">
					<div class="un_useful_61">
						<img style="width:48;height:48px;"src="../images/p3.gif">
					</div>
					<div class="un_useful_51"><a href="#">用户名用户名用户</a></div>
				</div>
				<div class="search_result"></div>
			</div>
			<div class="nav">
				<ul>
					<li class="index"><a href="index.php" >主页</a></li>
					<li class="music"><a href="music_home.php">音乐</a></li>
					<li class="movie"><a href="movie_home.php">影视</a></li>
					<li class="sport"><a href="sport_home.php">运动</a></li>
					<li class="funny"><a href="funny_home.php">趣味</a></li>
					<li class="people"><a href="people_home.php">人物</a></li>
					<li class="travel"><a href="travel_home.php">旅游</a></li>
					<li class="book"><a href="book_home.php">书籍</a></li>
					<li class="diet"><a href="diet_home.php">饮食</a></li>
					<li class="science"><a href="science_home.php">科技</a></li>
					<li class="other"><a href="other.php">其它</a></li>
				</ul>
			</div>
		</div>
	
			<div style="clear:both;"></div>
			
				<!--创建榜单弹出遮罩层-->
	<div id="list_name_input"style="background:url(../images/bg_body.gif);width:576px;height:258px;">
		<span style="color:blue;float:right;font:bold 15px 微软雅黑;padding:10px;cursor:pointer;"onclick="btn_close();">X</span>
		<div class="input_logo" style="background:url(../images/list_input_name.gif);width:173px;height:174px;clear:both;margin-top:50px;margin-left:30px;">
		</div>
		<div class="input_12" style="float:right;margin-top:-110px">
			<input type="text"style="background:url(../images/input.gif);width:306px;height:38px;border:0px;"/>
			<select style="width:55px;height:20px;font-size:15px;">
				<option>音乐</option>
				<option>趣味</option>
				<option>人物</option>
				<option>电影</option>
			</select><br/>
			<span style="font-size:12px;color:#838383;">你也可以稍后再填写</span>
		</div>
		<div class="next_btn"style="float:right;padding-right:58px;">
			<input type="button" value="下一步"style="font-size:15px;color:#fff;background:#43b7eb;width:79px;height:32px;border:0px;"/>
		</div>
		<div></div>
		
	</div>
			
			
			
			<div class="list_main">
			<div class="list_descr">
				<div class="title_descr">
					<div class="reset_list"><img class="png" src="../images/reset_list.png"></div>
					<a style="font:bold 24px 微软雅黑,sans-serif;"><?php echo $list_name;?></a><br/>
					<span>浏览:</span><label id="browse"><?php echo $browse_num;?></label>
					<span>投票:</span><label id="vote"><?php echo $vote_total;?></label>
					<span>内容项:</span><label id="content_total"><?php echo $content_count;?></label>
				</div>
				<div class="content_descr">
					<p><?php echo $introduction;?>
					<!--查看完整内容-->
					<div class="more_content_btn"><a>查看完整内容...</a></div>
					</p>
				</div>
				<div class="hidden_content_descr">
					<p>的教科书惊恐地觉得看撒即可 金卡黛珊健康四大皆空四大皆空刀扇肩铠谁看得见uiouis科技是的
					的教科书惊恐地觉得看撒即可 金卡黛珊健康四大皆空四大皆空刀扇肩铠谁看得见uiouis科技是的
					的教科书惊恐地觉得看撒即可 金卡黛珊健康四大皆空四大皆空刀扇肩铠谁看得见uiouis科技是的
					铠谁看得见uiouis科技是的铠谁看得见uiouis科技是的铠谁看得见uiouis科技是的
					<!--查看完整内容-->
					<div class="close_content_btn"><a><<收起</a></div>
					</p>
				</div>
			</div>
			<div class="shadow_descr"><img class="png" src="../images/shadow_descr.png"></div>
			<div class="list">
				<div class="list_left">
				
				<?php
				
				?>
					<div style="background:url(../images/bg_title.gif);width:512px;height:39px;margin:12px -11px auto;">
						<span class="title_rank">排名</span>
						<div class="title_num">
							<?php show_mode($listname_id,$type);?>
						</div>
					</div>
					<!--榜单列表-->
					<div class="content_list">
						<!--第一条榜单-->
						<?php show_list($listname_id,$type);?>
						
					
				</div>
				</div>
				<!--右边榜单-->
				<div class="list_right">
					<!--右边第一榜单样式-->
					<div class="list_1">
						<div style="background:url(../images/list_right.gif);width:155px;height:39px;margin:12px -11px auto;">
							<a href="person.php">Somebody</a>
						</div>
						<p style="font:15px 微软雅黑 #2f2f2f;padding-left:10px;">TA的其它榜单:</p>
						<div class="right_content_1">
							<p>在过去10年来最伟大的女歌手</p>
							<p>排名前10的女子电音</p>
							<p>儿童音乐天才</p>
							<p>最好的吉他的摇滚专辑最好的吉他的摇滚专辑</p>
							<p>最好的摇滚乐器 </p>
							<p>最好的吉他的摇滚专辑最好的吉他的摇滚专辑</p>
						</div>
						<!--更多按钮-->
						<p class="more_btn1" onclick="more_btn1();">更多>></p>
						<!--部分内容隐藏2-->
						<div class="more_content_1">
							<p>在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手</p>
						</div>
						<!--收起按钮-->
						<p class="close_btn1" OnClick="close_btn1();"><<收起</p>
					</div>
					<div class="right_shadow"><img class="png"src="../images/right_list_shadow.png"></div>
					 <div style="clear:both"></div>
					<div class="list_2">
						<div style="background:url(../images/list_right.gif);width:155px;height:39px;margin:12px -11px auto;">
							<a>相关榜单</a>
						</div>
						<div class="right_content_2">
							<p>在过去10年来最伟大的女歌手在过去10年来最伟大的女歌手</p>
							<p>排名前10的女子电音</p>
							<p>儿童音乐天才</p>
							<p>最好的吉他的摇滚专辑</p>
							<p>最好的摇滚乐器 </p>
							<p>最好的吉他的摇滚专辑</p>
							<p>最好的吉他的摇滚专辑最好的吉他的摇滚专辑</p>
						</div>
						<!--更多按钮-->
						<p class="more_btn2" onclick="more_btn2();">更多>></p>
						<!--部分内容隐藏2-->
						<div class="more_content_2">
							<p>在过去10年来最伟大的女歌手在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手在过去10年来最伟大的女歌手</p>
							<p>在过去10年来最伟大的女歌手在过去10年来最伟大的女歌手</p>
						</div>
						<!--收起按钮-->
						<p class="close_btn2" OnClick="close_btn2();"><<收起</p>
					</div>
					<div class="right_shadow"><img class="png"src="../images/right_list_shadow.png"></div>
				</div>
				
							<div class="leave_message">
				<div class="leave_message_1">
				<label style="color:#ddd;font-size:12px;">文明评论，构建和谐网络:</label>
					<textarea name="content" id="content" ></textarea>
					<input type="button" name="submit" value="提交" class="submit_message" onclick="comment(<?php echo $listname_id;?>,<?php echo $type;?>)"/>
															<!---留言显示区-->
					<div class="message_show">
																										<!--显示第一位用户留言-->
						<?php show_comment($listname_id,$type);?>
					</div>
				</div>
			</div>
				
			</div>
		</div>
	</div>
	<div style="DISPLAY: none" id=goTopBtn><img border=0 src="../images/go_top.png"></div>
	<script type="text/javascript">goTopEx();</script>
</body>
</html>







<?php

function show_comment($listname_id,$type){

	if($type==0){
	$table9="official_list_comment";
	
	}else{
	$table9="user_list_comment";

	}
				$page_comment=isset($_POST['page_comment'])?intval($_POST['page_comment']):1;
				$num_comment=8;
				$sqll="select * from ".$table9." where list_id='$listname_id' order by comment_time desc";
				$total_comment=mysql_num_rows(mysql_query($sqll));	
				$pagenum_comment=ceil($total_comment/$num_comment);	
				If($page_comment>$pagenum_comment|| $page_comment == 0){
						echo "还木有留言！赶快抢沙发哦！";
						exit;
				}

				$offset_comment=($page_comment-1)*$num_comment;//从第几页开始从数据库取数据
				
				$resultt=mysql_query("select * from ".$table9." where list_id='$listname_id' order by comment_time desc limit $offset_comment ,$num_comment")or die(mysql_error());
					while($roww=mysql_fetch_array($resultt)){
					if($roww['user_id']==0){
						$comment_name="游客";
					}else{
						$sqq="select * from userinf where id='$roww[user_id]'";
						$resulttt=mysql_query($sqq);
						$comment=mysql_fetch_array($resulttt)or die(mysql_error());
						$comment_name=$comment['username'];
					}
					?>
					
					<div class="message_show_1">
																													<!--用户头像-->
								<div class="user_photo_1">
									<img src="../images/user_photo.gif"/>
								</div>
																													<!--用户昵称-->
								<div class="user_name_1">
									<a href="#" style="color:#79C3F0;font-size:15px;"><?php echo $comment_name; ?></a>
									&nbsp;&nbsp;&nbsp;&nbsp;<a style="color:#8996A0;font-size:11px;"><?php echo $roww['comment_time'] ?></a>
								</div>
																													<!--用户留言内容-->
								<div class="message_show_content"style="width:600px;">
									<p><?php echo $roww['content'] ?></p>								
								</div>
							</div>
							
			
				<?php 
					}
			echo '<div class="feiye">';
				fenyexianshi($page_comment,$pagenum_comment,$type,"comment_fenye",$listname_id," -5","-5 ");////////////////逻辑分页、分块
			echo '</div>'; 
					
					
			}

function show_mode($listname_id,$type){

	if($type==0){
	$ta="official_list_mode";
	}else{
	$ta="user_list_mode";
	}
	$res=mysql_query("select * from ".$ta." where name_id='$listname_id'");
	$count=mysql_num_rows($res) ; 
	$ro=mysql_fetch_array($res) ;
	if($count==4){
	
	?>
			<div class="title_singer">
				<span><?php $ro=mysql_fetch_array($res); echo $ro['mode_name']; ?></span>
			</div>
	<?php } else if($count==5 || $count==6){		
	?>
			<div class="title_singer">
					<span><?php $ro=mysql_fetch_array($res); echo $ro['mode_name'];?></span>
			</div>
			<div class="title_song">
				<div class="title_song_name">
						<span><?php $ro=mysql_fetch_array($res);echo $ro['mode_name'] ;?></span>
				</div>
			</div>
	
	
	<?php	}

}
 
			
			
function show_list($listname_id,$type){


	if($type==0){
	$table3="official_list_mode";
	$table4="official_list_content";
	}else{
	$table3="user_list_mode";
	$table4="user_list_content";
	
	}


															
//////分页/////////////////////////////////////////////////////////////////////////////////////////////
					$page=isset($_GET['page'])?intval($_GET['page']):1;
				$num=10;	//每页显示条信息
				$count_mode=mysql_num_rows(mysql_query("select * from ".$table3."  where  name_id='$listname_id' ")); //多少个mode
				$total=mysql_num_rows(mysql_query("select * from ".$table4." where list_name_id='$listname_id'"));		//多少条数据
				$total=($total/$count_mode);					//多少条
							
				$pagenum=ceil($total/$num);										//总共有多少页
				if($page>$pagenum || $page == 0){
						echo "error : Can Not Found The page .";
						exit;
				}
				
				$offset=($page-1)*$num*$count_mode;//从第几页开始从数据库取数据
				$numb=$num*$count_mode;				//取多少条		
				$mode=mysql_query("select * from ".$table3."  where name_id='$listname_id'");
				$result=mysql_query("select * from ".$table4."  where list_name_id='$listname_id'  limit $offset,$numb")or die(mysql_error());
						
///////////////////////////////////输出列表/////////////////////////////////////////						
				if(($total%$num !=0) && $page==$pagenum){
					$count = $total%$num;
					}else{ 
					$count=$num; } 	
		for($k=0;$k<$count;$k++){			//条
					
					
					?>
			<div class="content_1" onmouseover="show_more(<?php echo $k+1;?>)" onmouseout="hide_more(<?php echo $k+1;?>)">	
				<div class="rank_singer" >
					
							<span class="rank_num"><?php echo ($k+1); ?></span>			<!----榜单排名-->
							<div class="pic_1">
								<img src="../image/<?php $rows=mysql_fetch_array($result); echo  $rows['content']; ?>"/>
							</div>

					<div class="info_content">
					<?php	
					
							if($count_mode==4){
							?>
							<div class="songer">
								<span><?php $rows=mysql_fetch_array($result); echo $rows['content'];?></span>
							</div>
							
							
							
							<?php }
							else if($count_mode==5){?>
							<div class="songer">
								<span><?php $rows=mysql_fetch_array($result); echo $rows['content'];?></span>
							</div>
							<div class="song_title">
							
								<div class="song">
									<span><?php $rows=mysql_fetch_array($result); echo $rows['content'];?></span>
								</div>
							</div>
							
							
							
							
							<?php }else if($count_mode==6){?>
							<div class="songer">
								<span><?php $rows=mysql_fetch_array($result); echo $rows['content'];?></span>
							</div>
							<div class="song_title">
								<div class="song">
									<span><?php $rows=mysql_fetch_array($result); echo $rows['content'];?></span>
								</div>							
								<div class="list_more_btn" id="more_button<?php echo $k+1;?>">
									<?php $rows=mysql_fetch_array($result); $more=$rows['content'];?>
									<span OnClick="show_detail(<?php echo $k+1;?>);">More...</span>
								</div>
							</div>
							
							<?php
							}
					?>
					</div>
				</div>
									<!--顶、踩按钮-->
							<div class="support_hate">	
								<div class="support">
								<?php $rows=mysql_fetch_array($result); ?>
									<input type="button" class="png" name="Ding" id="d<?php echo $rows['id']+100; ?>" value="" onclick="vote(0,<?php echo $rows['id']; ?>,<?php echo $listname_id; ?>,<?php echo $rows['ranking']; ?>,<?php echo $type; ?>)"/>
									<span id="v<?php echo $rows['id']+100; ?>" class="p1"><?php echo $rows['content']; ?></span>
								</div>
								<div class="hate">
									<?php $rows=mysql_fetch_array($result); ?>
									<input type="button" name="Cai" value="" class="png" id="c<?php echo $rows['id']+100; ?>" onclick="vote(1,<?php echo $rows['id']; ?>,<?php echo $listname_id; ?>,<?php echo $rows['ranking']; ?>,<?php echo $type; ?>)"/>
									<span id="s<?php echo $rows['id']+100; ?>" class="hate_num"><?php echo $rows['content']; ?></span>
								</div>
							</div>
							<div style="clear:both;"></div>
							<?php 
								if($count_mode==6){
							?>
							<div class="list_more_btn3" id="More<?php echo $k+1; ?>">
								<div class="detail">
									<p><?php  echo $more;?></p>
								</div>
								<div class="detail_close_btn">
									<span OnClick="close_detail(<?php echo $k+1; ?>);">Close</span>
								</div>
							</div>
							
								
			<?php
								}
				?>
				</div>	
		
		<?php	} 
			echo '<div class="feiye">';
			 fenyexianshi($page,$pagenum,$type,"content_fenye",$listname_id," -5","-5 ");////////////////逻辑分页、分块
			echo '</div>'; 
			
			


			
				}
				?>



